package com.dy.分类.数组._674_最长连续递增序列;
public class Solution{
    public int findLengthOfLCIS(int[] nums) {
        if(nums.length==0) return 0;
        int max =0;
        int dp[] = new int[nums.length];
        dp[0]=1;
        for(int i=1;i<nums.length;i++){
            if(nums[i]>nums[i-1]){
                dp[i] = dp[i-1]+1;
            }else{
                dp[i] = 1;
            }
            max = Math.max(max,dp[i]);
        }
        return max;
    }

    public int findLengthOfLCIS2(int[] nums) {
        if(nums.length==0) return 0;
        int max =1;
        int count =1;
        for(int i=1;i<nums.length;i++){
            if(nums[i]>nums[i-1]){
                count++;
            }else{
                count = 1;
            }
            max = Math.max(max,count);
        }
        return max;
    }
}